﻿using Basic.FormModel.DB;
using Basic.FormRemoteModel;
using WeDonekRpc.Helper;
using WeDonekRpc.SqlSugar;

namespace Basic.FormDAL.Repository
{
    internal class QueryControlDAL : BasicDAL<DBQueryControl, long>, IQueryControlDAL
    {
        public QueryControlDAL ( IRepository<DBQueryControl> basicDAL ) : base(basicDAL, "query.control")
        {
        }
        public void SetStatus ( long id, QueryControlStatus status )
        {
            if ( !this._BasicDAL.Update(A => A.Status == status, a => a.Id == id) )
            {
                throw new ErrorException("form.query.control.set.fail");
            }
        }
    }
}
